# -*- coding: utf-8 -*-
# @Time        :2025/4/17 16:33
# @Author      :文刀水寿
# @File        : urls.py
"""
 @Description :
"""
from fastapi import APIRouter, Request


app6 = APIRouter()


@app6.post('/request')
async def requests(request: Request):
    print("URL:", request.url)
    print("客户端IP地址:", request.client.host)
    print("请求头:", request.headers.get("uer-agent"))
    print("cookie:", request.cookies)

    return {
        "URL": request.url,
        "客户端IP地址": request.client.host,
        "请求头": request.headers.get("uer-agent"),
        "cookie": request.cookies
    }


